﻿@using MakeWeekConcerts.Models
@using Microsoft.AspNet.Mvc.Facebook.Models
@using Microsoft.AspNet.Mvc.Facebook
@model MyInterestingShows
@{
    ViewBag.Title = "Home Page";
}

<article class="intro">
    <span id="profilePicture">
        @if (Model.Self.ProfilePicture != null && Model.Self.ProfilePicture.Data != null)
        {
            <img class="img-polaroid" src="@Model.Self.ProfilePicture.Data.Url" />
        }
    </span>
    <h3>Welcome @Model.Self.Name</h3>
    <div><a target="_top" href="@GlobalFacebookConfiguration.Configuration.AppUrl@Url.Action("Friends")">Go to friends</a></div>
</article>

<article id="content">
    <div>
        <h4>Upcoming Shows</h4>
        <table class="table-striped table-bordered">
            <tr>
                <th>Artists</th>
                <th>Location</th>
                <th>Time</th>
                <th>Why You Might Be Interested</th>
                <th>&nbsp;</th>
            </tr>
            @foreach (var show in Model.InterestingShows)
            {
                <tr>
                    <td>
                        <ul>
                            @foreach (var artist in show.Show.Artists)
                            {
                                <li><a target="_top" href="@GlobalFacebookConfiguration.Configuration.AppUrl@Url.Action("ArtistDetails", new { artistName = artist })">@artist</a></li>
                            }
                        </ul>                      
                    </td>
                    <td><a target="_blank" href="@show.Show.EventLocationUri">@show.Show.EventLocationName</a></td>
                    <td>@show.Show.EventTimeStr</td>
                    <td>@show.InterestedReason()</td>
                    <td><a target="_top" href="@GlobalFacebookConfiguration.Configuration.AppUrl@Url.Action("ConcertDetails", new { id = show.Show.Id })">Plan an outing</a></td>
                </tr>
            }
        </table>
    </div>
</article>